#include<iostream>
#include<cmath> 
using namespace std;

bool iszhishu(int u){
    for(int i=2;i<=sqrt(u);i++){
        if(u%i==0) return false;
    }
    return true;
}

int main(){
    int n,i=1,j;
    cin>>n;

    for(j =3;i<n;j++){
        if(iszhishu(j)) i++;
    }
    cout<<j-1<<endl;
}
